<?php

namespace App\Kuafu\Common\Service;

use App\Kuafu\Config\Model\ConfigModel;

class ConfigService
{
    /**
     * 获取腾讯地图 keys 配置集合
     *
     * @return array
     */
    public static function getTencentMapConfig(): array
    {
        $tencentMapConfig = ConfigModel::query()
                                       ->where("type", "tencentMap")
                                       ->where("key", "keysConfig")
                                       ->first();

        return collect(
            attributeGet(
                jsonToArr(
                    attributeGet($tencentMapConfig, "value", "")
                ),
                "keys", []
            )
        )->pluck("key")
         ->toArray();
    }
}
